node=(
k8s-master1
k8s-master2
k8s-master3
k8s-node1
k8s-node2
)
for node in ${node[@]};do
echo $node
expect -c "   
spawn ssh-copy-id root@$node 
expect {   
 \"*yes/no*\" {send \"yes\r\"; exp_continue}   
 \"*password*\" {send \"xunlei\r\"; exp_continue}   
 \"*Password*\" {send \"$password\r\";}
            }
    "
done




